// 错误演示
{
  type free = "tabClick";
  interface Emits {
    (e: free, val: string): void;
    // (e: number, val: number): string;
  }
  
  /*
    1. 如果只是定义的话ts不会报错
    2. 下面之心的话就会报错: 函数参数: e, val会有冲突
    3. emit('tabClick', '123'); 赋值调用的时候是走上面的还是下面的呢 ts无法确定
  */
  const emit: Emits = (e: free, val: string) => { console.log(val); }
  emit('tabClick', '123');
}

// 问题解决
{
  type free = "tabClick";
  interface Emits {
    first: (e: free, val: string) => void;
    second: (e: string, val: string) => string | void;
  }
  const emits: Emits['second'] = (e: string, val: string) => console.log(`${e}${val}`)
  emits('tabClick', '123');
}